var email;
var openid;

function myAuth() {

    var authorize_url = "https://www.google.com/accounts/o8/ud?openid.return_to=http://mytaxisharing.alwaysdata.net/checkAuth&openid.ns=http://specs.openid.net/auth/2.0&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&openid.mode=checkid_setup&openid.ns.ax=http://openid.net/srv/ax/1.0&openid.ax.mode=fetch_request&openid.ax.type.email=http://axschema.org/contact/email&openid.ax.type.language=http://axschema.org/pref/language&openid.ax.required=email,language";

    window.plugins.childBrowser.onLocationChange = openIDLocChanged;
    window.plugins.childBrowser.onClose = closed;
    window.plugins.childBrowser.showWebPage(authorize_url);

}

function openIDLocChanged(loc) {

    if (/mytaxisharing.alwaysdata.net\/checkAuth/.test(loc) && !/openid\.mode=cancel/.test(loc)) {

        email = loc.match(/openid\.ext1\.value\.email=(.*)$/)[1]
        openid = loc.match(/openid\.identity=(.*)$/)[1]

        window.plugins.childBrowser.close();
    }
}